package com.itheima.day12.log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * 目标：掌握日志框架logback的基本使用
 */
public class Test {
    //1.框架下载：三个
    //2.配置文件：logback.xml
    //3.使用：在需要日志记录的类中，定义记录日志的对象：Logger logger = LoggerFactory.getLogger(Test.class);
public static final Logger log = LoggerFactory.getLogger(Test.class);


    public static void chu(int a, int b){
        log.info("\t开始除法操作...");
        //System.out.println("\t除法参数："+a);
        log.info("\t除法参数："+a);
        //System.out.println("\t除法参数："+b);
        log.info("\t除法参数："+b);
        int c = a / b;
        //System.out.println("\t除法结果："+c);
        log.info("\t除法结果："+c);
    }


    public static void main(String[] args) {

        try {
            //System.out.println("开始除法操作...");
            log.info("开始除法操作...");
            chu(10, 0);
            //System.out.println("结束除法操作...");
            log.info("结束除法操作...");
        } catch (Exception e) {
            //System.out.println("除法操作异常！");
            log.error("除法操作异常！");
        }

    }
}
